#-------------------------------------------------
#
# Project created by QtCreator 2025-07-27T14:01:14
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = 101_test_rgb_qt
TEMPLATE = app

DEFINES += QT_DEPRECATED_WARNINGS

#连接sdl库
LIBS += -lSDL2 -lavutil -lavcodec
#LIBS += -lavutil -lavcodec


# ==== 完整的目录管理配置 ====
# 定义基础路径
ROOT_DIR = $$PWD/..
BUILD_BASE = $$ROOT_DIR/build
OUTPUT_BASE = $$ROOT_DIR/output

# 分离调试和发布版本
CONFIG(debug, debug|release) {
    # 调试版本
    BUILD_DIR = $$BUILD_BASE/debug
    DESTDIR = $$OUTPUT_BASE/debug
    TARGET = $${TARGET}_debug
} else {
    # 发布版本
    BUILD_DIR = $$BUILD_BASE/release
    DESTDIR = $$OUTPUT_BASE/release
}

# 设置所有中间文件目录
OBJECTS_DIR = $$BUILD_DIR/obj
MOC_DIR = $$BUILD_DIR/moc
RCC_DIR = $$BUILD_DIR/rcc
UI_DIR = $$BUILD_DIR/ui

# 确保所有目录存在
!exists($$BUILD_DIR) { mkpath($$BUILD_DIR) }
!exists($$OBJECTS_DIR) { mkpath($$OBJECTS_DIR) }
!exists($$MOC_DIR) { mkpath($$MOC_DIR) }
!exists($$RCC_DIR) { mkpath($$RCC_DIR) }
!exists($$UI_DIR) { mkpath($$UI_DIR) }
!exists($$DESTDIR) { mkpath($$DESTDIR) }

#把bin文件里面的图片复制到输出目录
bin.files = bin/*
bin.path = $$DESTDIR/bin
COPIES += bin

INCLUDEPATH += $$OUT_PWD
INCLUDEPATH += $$OUT_PWD/ui
INCLUDEPATH += $$UI_DIR

SOURCES += \
        main.cpp \
        testrgb_qt.cpp \
    XVideoView.cpp \
    xsdl.cpp

HEADERS += \
        testrgb_qt.h \
    xvideoview.h \
    xsdl.h

FORMS += \
        testrgb_qt.ui

# 调试信息
message("构建目录: $$BUILD_DIR")
message("输出目录: $$DESTDIR")
message("目标文件: $$TARGET")
